Conversation
Enable admin users to download uploaded slide files directly from talk submissions, with loading state and error handling for failed storage downloads.
Display each submission with a TalkThumbnail and reorganize details into a responsive two-column section with subtle grouped backgrounds for metadata and description content.
Replace the separate status dropdown with a badge-style header select that preserves the existing look while supporting inline updates, adaptive sizing, and custom chevron styling.
Reorder talk cards to prioritize thumbnail and description content, add phone number to admin fields, and improve responsive behavior for stacked thumbnail and metadata grids on smaller screens.
|
You have used all of your free Bugbot PR reviews. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
Let admins click any submission thumbnail to jump into the thumbnail generator with hook, speaker, and photo context already loaded so download actions are faster and consistent.
|
Checking this out |
Move the thumbnail generator route to /admin/thumbnails and enforce shared admin auth with a reusable hook used by both admin pages to keep access control consistent.
| WHERE profiles.user_id = auth.uid() | ||
| AND profiles.is_admin = TRUE | ||
| ) | ||
| ); |
There was a problem hiding this comment.
I think we need to guard against users self editing is_admin.
I think this will guard appropriately:
CREATE OR REPLACE FUNCTION protect_is_admin()
RETURNS TRIGGER AS $$
BEGIN
IF current_setting('role') != 'service_role'
AND session_user != 'postgres' THEN
IF TG_OP = 'INSERT' AND NEW.is_admin = TRUE THEN
RAISE EXCEPTION 'Only service_role can set is_admin';
ELSIF TG_OP = 'UPDATE' AND NEW.is_admin IS DISTINCT FROM OLD.is_admin THEN
RAISE EXCEPTION 'Only service_role can modify is_admin';
END IF;
END IF;
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER protect_is_admin_trigger
BEFORE INSERT OR UPDATE ON profiles
FOR EACH ROW
EXECUTE FUNCTION protect_is_admin();
tomatrow
left a comment
There was a problem hiding this comment.
I tested it out; seems good, except for the is_admin guard
|
I addressed AJ's escalation feedback with a fixup commit on my branch:\n\n- Branch: \n- Commit: \n- Message: \n\nDiff adds a DB trigger/function guard in to block non-privileged changes, and makes column/index creation idempotent ().\n\nI don't have push rights to , so please cherry-pick this commit:\n\n |
|
Follow-up with exact cherry-pick details for AJ's
What changed:
I don't have push rights to git fetch https://github.com/bobbythelobster/devx.network.git sam/admin-talks-aj-fix
git cherry-pick 554c575 |
Made-with: Cursor
Fixes up and replaces #86
Summary
profiles.is_admin(migration + index)talk_submissionscheckIsAdmin()helper/admin/talksto review all submissions, filter by status, and update statusValidation
bunx tsc --noEmitbun run lint(passes; only existing warnings inapp/layout.tsx)Notes
profiles.is_admin = truefor a user